<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /***
         * 中断链式调用
         * 1. Promise.then为什么可以进行链式调用，答因为then返回的还是一个Promise对象
         * 2. 如何中断链式调用:返回一个pending状态的Promise对象
         */

        let p = new Promise((resolve, reject)=>{
            resolve('ok')
        })

        p.then(value=>{
            console.log('1111');
            // return value;
            return new Promise((resolve, reject)=>{})
        }).then(value=>{
            console.log('2222');
            return value;
        }).then(value=>{
            console.log(value);
        })
    </script>
</body>
</html>